<?php
    $contents = file_get_contents("seeds_nodup.lst");
    $seeds = explode("\n", $contents);
    $targetNums = [
        ${A},
        ${B},
        ${C},
        ${D},
        ${E},
        ${F},
        ${G},
        ${H},
        ${I},
        ${J}
    ];
    
    foreach ($seeds as $seed){
        srand((int)$seed);
        $itr = 0;
        foreach ($targetNums as $num) {
            if (rand() !== $num) {
                break; // Exit if any number doesnt match.
            }
            $itr = $itr + 1;
        }
        if ($itr == 10) {
            // If the list was exhausted then the seed was found
            echo "\n----------------------------------\n";
            echo "SUCCESS!\n";
            echo "SEED: $seed\n";
            echo "----------------------------------\n\n";
            break;
        }
    }
?>
